package com.zsc.ssm.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.zsc.ssm.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * Created by jasonzhu on 2016/11/21.
 */
@Controller
public class TestController extends BaseController {

    @Resource
    private UserService userService;

    @ResponseBody
    @RequestMapping("/page")
    public Object selectPage(HttpServletRequest request) {

        EntityWrapper ew=new EntityWrapper();

        String username = request.getParameter("username");
        Page page = new Page(1, 10);
        page = userService.selectUserPage(page, username);
        return page;
    }

}
